import type { StringKeyObject } from 'my-web-core/interfaces';
import { RouteMapManager } from 'my-web-core/services';

/**
 * IMPORTANT!!!
 * Always keep it in mind that permission / authentication / authorization MUST be applied on server side first.
 * Any client side check is for user experience ONLY.
 * NEVER TRUST CLIENT!
 */
export default class RouteMapConfig {
  static getMapping(): StringKeyObject {
    return {
      // region: The configuration allows anonymous access.
      '/authentication/login': RouteMapManager.permitAll,
      '/stomp-demo': RouteMapManager.permitAll,
      // endregion

      // region: The configuration allows authenticated access.
      '/home': RouteMapManager.isAuthenticated,
      '/user/**': RouteMapManager.isAuthenticated,
      // endregion

      // region: The configuration only allows account group user and admin access.
      // endregion

      // region: The configuration allows account group admin access.
      // endregion
    };
  }
}
